<style>
    .is-dialog #main{
        background: #f4f6fa !important;
    }
    .mb-3 {
        margin-bottom: 1px!important;
    }

.avatar {
    width: 30px;
    height: 30px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #656d77;
    text-align: center;
    text-transform: uppercase;
    vertical-align: bottom;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    background: #f0f2f6 no-repeat center/cover;
    border-radius: 50%;
}
.card {
    box-shadow: rgba(35,46,60,.04) 0 2px 4px 0;
    border: 1px solid rgba(101,109,119,.16);
    position: relative;
    display: flex;
    flex-direction: column;
    min-width: 0;
    word-wrap: break-word;
    background-color: #fff;
    background-clip: border-box;
    border: 1px solid rgba(101,109,119,.16);
    border-radius: 4px;
}
.card-body {
    flex: 1 1 auto;
    padding: 10px 10px;
}
.align-items-center {
    align-items: center !important;
}
.rounded {
    border-radius: 4px !important;
}
.col-3 img {
    width: 100%;
}
.card-title {
    display: block;
    margin: 0 0 10px;
    font-size: 18px;
    font-weight: 500;
    line-height:30px;
}
.mb-1 {
    margin-bottom: 0.25rem !important;
}
.text-muted {
    color: #656d77 !important;
}
.col {
    flex: 1 0 0%;
    margin-left: 10px;
}
.col-3 {
    flex: 0 0 auto;
    width: 140px;
    height:100px;
    overflow: hidden;
}
.row_cards {
    display: flex;
    flex-wrap: wrap;
}
.info-table tr td {
    text-align: center;
}
.tag_deer_1{
        background-color: #18bc9c;
        color:#fff;
        font-size: 12px;
        border-radius: 2px;
        padding:1px 8px;
    }
    .tag_deer_2{
        background-color: #9c9c9c;
        color:#fff;
        font-size: 12px;
        border-radius: 2px;
        padding:1px 8px;
    }
</style>
<div class="row row-cards">
    <div class="col-sm-12">
        <div class="panel panel-default  panel-intro">
            <div class="panel-body">
                    <div class="card-body">
                      <div class="row_cards align-items-center" >
                        <div class="col-3">
                          <img src="{$row.card.face_image|htmlentities|default='/assets/addons/deerhome/img/gray.png'}" alt="{$row.deerhome_card_name|htmlentities}" class="rounded">
                        </div>
                        <div class="col">
                          <h3 class="card-title mb-1">
                            {$row.deerhome_card_name|htmlentities}
                          </h3>
                          <div class="text-muted">
                            <span class="label label-info fa fa-credit-card" style="font-size: 12px;">&nbsp;{$row.time_area_text|htmlentities}</span> 剩余: {$row.num_left|htmlentities}次 / 总计：{$row.num_total|htmlentities}次
                          </div>
                          {if $row.time_area!=1}
                          <div class="text-muted">
                            <i class="fa fa-clock-o"></i>&nbsp;离到期{$row.left_day_text|htmlentities}天 / <i class="fa fa-calendar-check-o"></i>&nbsp;{$row.end_time|htmlentities}
                          </div>
                          {/if}
                          <div class="mt-3">
                            <div class="progress">
                                <div class="progress-bar progress-bar-warning progress-bar-striped active" role="progressbar" aria-valuenow="{$row.left_num_percent}" aria-valuemin="0" aria-valuemax="100" style="width: {$row.left_num_percent}%">
                                  剩余{$row.left_num_percent}%
                                </div>
                              </div>
                          </div>
                        </div>
                      </div>
                    </div>
                <table class="table table-bordered table-hover table-striped">
                    <tbody>
                        <tr>
                            <td >订单编号</td>
                            <td>{$row.sn|htmlentities}</td>
                            <td >下单用户UID</td>
                            <td>
                                <span class="label label-default">UID {$row.user.id}</span>
                            </td>
                        </tr>
                        <tr>
                            <td >订单状态</td>
                            <td>
                                {if condition="$row.status eq 1"}
                                <span class="label label-danger"><i class="fa fa-clock-o"></i> {$row.status_text|htmlentities}</span>
                                {elseif condition="$row.status eq 2"}
                                <span class="label label-success"><i class="fa fa-check"></i> {$row.status_text|htmlentities}</span>
                                {else/}
                                <span class="label label-default">{$row.status_text|htmlentities}</span>
                                {/if}
                            </td>
                            <td >用户信息</td>
                            <td style="display: flex;align-items: center;">
                                <span class="avatar avatar-rounded" style="background-image: url({$row.user.face_image|htmlentities})"></span>
                                &nbsp;{$row.user.uname|htmlentities}
                            </td>
                        </tr>
                        <tr>
                            <td >订单原价</td>
                            <td >{$row.price|htmlentities}</td>
                            <td >手机号码</td>
                            <td>{$row.user.utel|htmlentities}</td>
                        </tr>
                        <tr>
                            <td >优惠金额</td>
                            <td >-{$row.price_yh|htmlentities} {if $row.price_yh_note} ({$row.price_yh_note|htmlentities}){/if}</td>
                            <td >上级用户</td>
                            <td >{$row.agent_lev1_uid==0?'本单不参与分销':'UID'.$row.agent_lev1_uid}</td>
                        </tr>
                        <tr>
                            <td >实付金额</td>
                            <td style="color:#f75444;">￥{$row.price_payed|htmlentities}</td>
                            <td >上级分销佣金</td>
                            <td >
                                ￥{$row.agent_lev1_price} <span class="tag_deer_{$row.agent_lev1_price_js}">{$row.agent_lev1_price_js==1?'已入账':'未入账'}</span>
                            </td>
                        </tr>
                        <tr>
                            <td >下单时间</td>
                            <td >{$row.add_time|htmlentities}</td>
                            <td >上上级用户</td>
                            <td >{$row.agent_lev2_uid==0?'-':'UID'.$row.agent_lev2_uid}</td>
                        </tr>
                        <tr>
                            <td >支付时间</td>
                            <td >{$row.pay_time|htmlentities}</td>
                            <td >上上级分销佣金</td>
                            <td >
                                ￥{$row.agent_lev2_price} <span class="tag_deer_{$row.agent_lev2_price_js}">{$row.agent_lev2_price_js==1?'已入账':'未入账'}</span>
                            </td>
                        </tr>
                    </tbody>
                </table>
            </div>
            <!-- /panel-body -->
        </div>
    </div>
</div>


<div class="panel panel-default panel-intro" style="margin-top:10px;">
    <div class="panel-heading">
        <ul class="nav nav-tabs" data-field="status">
            <li class="active"><a href="#t-all" data-value="" data-toggle="tab">套餐内容</a></li>
        </ul>
    </div>
    <div class="panel-body">
        <table class="table table-bordered table-hover table-striped">
            <thead>
                <tr>
                    <th>#</th>
                    <th>产品名称</th>
                    <th>规格名称</th>
                    <th>规格单位</th>
                    <th style="text-align: center;">套餐单价</th>
                    <th style="text-align: center;">套餐次数</th>
                    <th style="text-align: center;">剩余次数</th>
                </tr>
            </thead>
            <tbody>
                {volist name="row.order_items" id="vo"  key="index"}
                <tr>
                    <td >#{$index}</td>
                    <td style="word-break: break-all;">{$vo.deerhome_items_name|htmlentities}</td>
                    <td>{$vo.gg_name|htmlentities}</td>
                    <td>{$vo.gg_dw|htmlentities}</td>
                    <td  align="right">￥{$vo.price|htmlentities}</td>
                    <td align="center">{$vo.num|htmlentities}</td>
                    <td align="center" style="color:#f75444;">{$vo.num_left|htmlentities}</td>
                </tr>
                {/volist}
                <tr>
                    <td colspan='5' align="right" style="font-weight:bold;">合计</td>
                    <td align="center" style="font-weight:bold;">{$row.num_total|htmlentities}</td>
                    <td align="center" style="color:#f75444;font-weight:bold;">{$row.num_left|htmlentities}</td>
                </tr>
            </tbody>
        </table>
    </div>
</div>

<div class="panel panel-default panel-intro">
    <div class="panel-heading">
        <ul class="nav nav-tabs" data-field="status">
            <li class="active"><a href="#t-all" data-value="" data-toggle="tab">消费记录</a></li>
        </ul>
    </div>
    <div class="panel-body">
        <table class="table table-bordered table-hover table-striped">
            <thead>
                <tr>
                    <th>服务状态</th>
                    <th>服务订单号</th>
                    <th>产品名称</th>
                    <th>规格名称</th>
                    <th style="text-align: center;">消费数量</th>
                    <th style="text-align: center;">消费时间</th>
                </tr>
            </thead>
            <tbody>
                {volist name="row.order" id="vo"  key="index" empty="<tr><td align='center' colspan='6'>暂无数据</td></tr>"}
                <tr>
                    <td >
                        <span class="label label-primary">{$vo.status_text}</span>
                    </td>
                    <td ><span data-toggle="tooltip" title="查看详情" class="btn-order_detail" style="cursor: pointer;color:#1688f1;" data-title="【服务订单】{$vo.sn}" data-url="{:url('deerhome/order/detail',['sn'=>$vo.sn])}">{$vo.sn}</span></td>
                    <td style="word-break: break-all;">{$vo.item_name|htmlentities}</td>
                    <td>{$vo.item_gg_name|htmlentities}</td>
                    <td style="text-align: center;">{$vo.num|htmlentities}</td>
                    <td  style="text-align: center;">{$vo.time_add}</td>
                </tr>
                {/volist}
            </tbody>
        </table>
    </div>
</div>
<div class="panel panel-default panel-intro">
    <div class="panel-heading">
        <ul class="nav nav-tabs" data-field="status">
            <li class="active"><a href="#t-all" data-value="" data-toggle="tab">支付流水</a></li>
        </ul>
    </div>
    <div class="panel-body">
        <table class="table table-bordered info-table">
            <thead>
                <tr>
                    <th class="text-center">
                        <div class="th-inner">付款状态</div>
                    </th>
                    <th class="text-center">
                        <div class="th-inner">支付流水号</div>
                    </th>
                    <th class="text-center">
                        <div class="th-inner">金额</div>
                    </th>
                    <th class="text-center">
                        <div class="th-inner">付款时间</div>
                    </th>
                    <th class="text-center">
                        <div class="th-inner">备注</div>
                    </th>
                </tr>
            </thead>
            <tbody>
                {volist name="$row.orderPayLog" id="item"}
                <tr>
                    <td>
                        {if condition="$item.status eq 1"}
                        <span class="label label-danger"><i class="fa fa-clock-o"></i> 待支付</span>
                        {elseif condition="$item.status eq 2"}
                        <span class="label label-success"><i class="fa fa-check"></i>
                            已支付</span>
                        {else/}
                        <span class="label label-default">已取消</span>
                        {/if}
                    </td>
                    <td>{$item.order_sn}S{$item.id}
                        <br/>
                        {if condition="$item.status neq 1"}
                            {if condition="$item.payway_type eq 1"}
                            线上
                            {else/}
                            线下
                            {/if}
                            / {$item.pay_way}
                        {/if}
                        
                    </td>
                    <td>{$item.price}</td>
             
                    <td>{$item.pay_time}</td>
                    <td>{$item.note}</td>
                </tr>
                {/volist}
            </tbody>
        </table>
    </div>
</div>